#import "AboutViewController.h"

@interface AboutViewController ()

@end

@implementation AboutViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    self.navigationController.navigationBar.backgroundColor =[UIColor clearColor]; //导航上那条黑线的原因在这里
    
    UIButton* backBtn= [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"nav_bar_back_1.png"] forState:UIControlStateNormal];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"nav_bar_back_2.png"] forState:UIControlStateHighlighted];
    [backBtn addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem* backBarBtn= [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    [self.navigationItem setLeftBarButtonItem:backBarBtn];
    [backBarBtn release];
    [backBtn release];
    
    baseTitle.text = @"关于";

    //左右两端为“上”圆角的按钮图 
    UIImage *btnUpCircleOne = [[UIImage imageNamed:@"btn_up_circle_1.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:21];
    UIImage *btnUpCircleTwo = [[UIImage imageNamed:@"btn_up_circle_2.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:21];
    //中间的按钮图
    UIImage *btnMiddleOne= [[UIImage imageNamed:@"btn_middle_1.png"] stretchableImageWithLeftCapWidth:2 topCapHeight:21];
    UIImage *btnMiddleTwo = [[UIImage imageNamed:@"btn_middle_2.png"] stretchableImageWithLeftCapWidth:2 topCapHeight:15];
    //左右两端为“下”圆角的按钮图
    UIImage *btnDownCircleOne = [[UIImage imageNamed:@"btn_down_circle_1.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:21];
    UIImage *btnDownCircleTwo = [[UIImage imageNamed:@"btn_down_circle_2.png"] stretchableImageWithLeftCapWidth:15 topCapHeight:21];

    [weilcomeBtn setBackgroundImage:btnUpCircleOne forState:UIControlStateNormal];
    [weilcomeBtn setBackgroundImage:btnUpCircleTwo forState:UIControlStateHighlighted];
    [functionInformationBtn setBackgroundImage:btnMiddleOne forState:UIControlStateNormal];
    [functionInformationBtn setBackgroundImage:btnMiddleTwo forState:UIControlStateHighlighted];
    [versionBtn setBackgroundImage:btnDownCircleOne forState:UIControlStateNormal];
    [versionBtn setBackgroundImage:btnDownCircleTwo forState:UIControlStateHighlighted];
    
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}


- (void)back{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc {
    PP_RELEASE(weilcomeBtn);
    PP_RELEASE(functionInformationBtn);
    PP_RELEASE(versionBtn);
    [super dealloc];
}
- (void)viewDidUnload {
    PP_RELEASE(weilcomeBtn);
    PP_RELEASE(functionInformationBtn);
    PP_RELEASE(versionBtn);
    [super viewDidUnload];
}
@end
